#! /usr/bin/env python

# Jeremy's scratch test code.
# (scezumin)

import time
from simulation import *

import sys

map = sys.argv[1]

if sys.argv[2] == "k":
	sim = KSigmaSimulation(map)
else:
	sim = SweepSimulation(map)

sim.duration = 36
#sim.timestep = 3

try:
	for i in sim.emitters:
		e = sim.emitters[i]
		e.setIntensity(float(sys.argv[3]))
except:
	print "defaulting to one mCi source"

for i in sim.detectors:
	d = sim.detectors[i]
	d.setTheta(7.5, "deg")
	print "%3s: %16s\t%s" % (d.id,
	                         d.p,
	                         d.name)

for i in sim.emitters:
	e = sim.emitters[i]
	print "%3s: %16s\t%s" % (e.id,
	                         e.p,
	                         e.name)
	print "also, intensity of %s mCi" % e.intensity

hm = sim.heatmap


sim.run(saveVisuals=True)


# show off for 20 seconds before terminating
time.sleep(5)